package com.ronsai.umtrack.util;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

public class ParamsUtil {

    /**
     * retrofit 请求参数map不能有空值的key，此处遍历移除。
     */
    public static HashMap<String, String> notNullValue(HashMap<String, String> map) {
        for (Iterator<Map.Entry<String, String>> it = map.entrySet().iterator(); it.hasNext(); ) {
            Map.Entry<String, String> item = it.next();
            if (item.getValue() == null) {
                it.remove();
            }
        }
        return map;
    }

}
